<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Knowbase_project_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-knowbase_project_id" data-field="title" data-rule="required" data-source="knowbase/project/index" class="form-control selectpage" name="row[knowbase_project_id]" type="text" value="{$project_id|htmlentities}" disabled>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if $parent_page && $parent_page['deep']>=3} 
                <input  type="hidden" name="row[type]" value="file" >
            {/if}            
            <select  id="c-type" data-rule="required" class="form-control selectpicker " name="row[type]" {if $parent_page && $parent_page['deep']>=3} disabled {/if}>
                {foreach name="typeList" item="vo"}
                    {if $parent_page && $parent_page['deep']>=3}
                        <option value="{$key|htmlentities}" {in name="key" value="file"}selected{/in}>{$vo|htmlentities}</option>
                    {else}
                        <option value="{$key|htmlentities}" {in name="key" value="dir"}selected{/in}>{$vo|htmlentities}</option>
                    {/if}
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-pid" data-field="title" data-rule="required" data-params='{"knowbase_project_id":"{$project_id|htmlentities}","id":"0","from":"select"}' data-source="knowbase/project_page/index" class="form-control selectpage" name="row[pid]" type="text" value="{$pid|htmlentities}">
        </div>
    </div>
    
    <div class="form-group hide">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status_switch')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <input  id="c-status_switch" name="row[status_switch]" type="hidden" value="1">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status_switch" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success  fa-2x"></i>
            </a>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
        </div>
    </div>
<!--    <div class="form-group identify">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Identify')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-identify" class="form-control" name="row[identify]" type="text" value="">-->
<!--            <span class="help-block">{:__('tips_page_identify')}</span>-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group page_content" >
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="c-content-vditor" class="vditor_editor" >

            </div>
            <textarea id="c-content" class="form-control vditor hide" rows="5" name="row[content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group url" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('跳转链接')}:</label>
        <div class="col-xs-12 col-sm-8">
              <input id="c-url" data-rule="url" class="form-control" name="row[url]" type="text" value="">
        </div>
    </div>
    <div class="form-group attachfiles hide" {if  !$parent_page || $parent_page['deep']<3} style="display: none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Attachfiles')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-attachfiles" class="form-control" size="50" name="row[attachfiles]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-attachfiles" class="btn btn-danger faupload" data-input-id="c-attachfiles" data-multiple="true" data-preview-id="p-attachfiles"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-attachfiles" class="btn btn-primary fachoose" data-input-id="c-attachfiles" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-attachfiles"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-attachfiles"></ul>
        </div>
    </div>

    <div class="form-group password" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
            <input id="c-password" class="form-control" name="row[password]" type="text" value="">
                <span class="input-group-btn">
                    <a class="btn btn-default btn-random" >{:__('create_random')}</a>
                </span>
        </div>
    </div>
    </div>
    <div class="form-group user_group_ids"  style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_group_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_group_ids"  data-source="user/group/index" data-multiple="true" class="form-control selectpage" name="row[user_group_ids]" type="text" value="">
        </div>
    </div>
    <div class="form-group hide">
        <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-views" min="0" class="form-control" name="row[views]" type="number" value="0">
        </div>
    </div>
   
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
             <span class="help-block">{:__('tips_weigh')}</span>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="submit" class="btn btn-success {:$auth->check('knowbase/project_page_template/index')?'':'hide'}"  id="template">{:__('btn_look_template')}</button>
        </div>
    </div>
</form>
